﻿using HuiLian.Cloud.Controls;
using HuiLian.Cloud.ViewModel;
using HuiLian.Cloud.View;
using HuiLian.Cloud.ViewModel.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace HuiLian.Cloud.ViewModel
{
    public class VerifyWindowViewModel : ViewModelBase
    {
        private string memberAccount = "";

        public string MemberAccount 
        { 
            get { return memberAccount; } 
            set { memberAccount = value; OnPropertyChanged("MemberAccount"); } 
        }

        #region
        public ICommand OnNumberClickCommand => new DelegateCommand((sender) =>
        {
            if (sender is BorderButton button)
            {
                MemberAccount += button.Content;
            }
        });
        public ICommand OnDeleteClickCommand => new DelegateCommand((sender) => 
        { 
            if (MemberAccount != null && MemberAccount.Length > 0)
            {
                MemberAccount = MemberAccount.Substring(0, MemberAccount.Length - 1);
            }
        });
        public ICommand OnClearClickCommand => new DelegateCommand((sender) =>
        {
            if (MemberAccount != null && MemberAccount.Length > 0)
            {
                MemberAccount = "";
            }
        });
        #endregion
    }
}
